DataHandler.SecretManager
Handles the creation, reading, deletion overall management of secret vaults.
Represents a reference to an encrypted secret file.
Fields:
Constructor:
PublicKeyFile(string secretName, string secretPath)
Used to initialize a new secret entry when creating a bank.
Fields:
Constructor:
PublicKeyFileInit(string secretName, SecureData? secretPath, SecureData value)
Creates a “bank” JSON file listing public secrets, and optionally initializes individual secret files.
Parameters:
Returns: Task
Exceptions:
Checks for the existence of the bank JSON file.
Parameters:
Returns: Task — true if the bank file exists.
Retrieves and decrypts a public secret value from a bank.
Parameters:
Returns: Task — Decrypted secret value.
Exceptions:
Reads the “Pneumentations” (rotation count) for a public secret.
Parameters: Same as GetPublicSecret minus SecretDecryptKey.
Returns: Task — Current rotation count.
Adds a new secret to an existing bank, creating its file and encrypting its initial value.
Parameters:
Returns: Task
Removes a secret entry from both the bank JSON and deletes its file.
Parameters:
Returns: Task
Lists all logical secret names in the bank.
Rotates (re-hashes) a secret’s value, updates its “Pneumentations” count, and writes back.
Parameters:
Returns: Task — New rotated secret.
WIP — Re-encrypts and/or moves existing secrets to a new bank directory with optional password/key changes.
Parameters:
Returns: Task
Notes: Not production-ready; use with caution.